<template lang="">
  <div
    class="_flex _flex-space-x tab-box _flex-center"
    style="z-index: 9; position: relative"
  >
    <template v-for="item in dictList" :key="item.val">
      <div
        @click="updateType(item.val)"
        :class="{ '_active-bottom': modelValue == item.val }"
      >
        {{ item.name }}
      </div>
    </template>
  </div>
</template>
<script>
export default {
  props: {
    modelValue: {
      type: String,
      required: true,
    },
    dictList: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    updateType(type) {
      this.$emit("update:modelValue", type);
    },
  },
};
</script>
<style scoped>
.tab-box > * {
  background: rgb(0, 0, 0, 0.2);
  padding: 5px;
  font-size: 14px;
  text-align: center;
  border-radius: 50px;
  width: 100px;
  color: #333;
}
.tab-box > *:hover {
  background: rgba(32, 126, 214, 0.4);
  font-weight: bold;
}
</style>
